/**
 * @Project Name:blog-business-service
 * @Package Name:cn.hoofungson.blog.business.service.provider.model.entity.article
 * @Since JDK 1.8
 */

package cn.hoofungson.blog.business.service.provider.model.entity.article;

import cn.hoofungson.blog.business.service.interfaces.enums.article.ArticleContentType;
import cn.hoofungson.blog.business.service.interfaces.enums.article.ArticleSourceType;
import cn.hoofungson.blog.business.service.interfaces.enums.article.ArticleStatus;
import cn.hoofungson.blog.business.service.interfaces.enums.article.ArticleType;
import cn.hoofungson.blog.business.service.provider.model.entity.channel.ChannelPO;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Description: ArticlePO
 * @Author 胡松 hoofungson@163.com
 * @Date 2020-03-24 22:09
 * @Version V1.0
 */
@Data
@Entity
@Table(name = "hb_article")
public class ArticlePO implements Serializable {

    @Id
    @GenericGenerator(name = "archive_generator", strategy = "increment")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "archive_generator")
    private Long id;
    @ManyToOne
    @JoinColumn(name = "channel_id")
    private ChannelPO channelPO;
    @Column(name = "type")
    @Enumerated(EnumType.STRING)
    private ArticleType articleType;
    @Column(name = "status")
    @Enumerated(EnumType.STRING)
    private ArticleStatus articleStatus;
    @Column(name = "title")
    private String title;
    @Column(name = "short_title")
    private String shortTitle;
    @Column(name = "summary")
    private String summary;
    @Column(name = "source_type")
    @Enumerated(EnumType.STRING)
    private ArticleSourceType articleSourceType;
    @Column(name = "source_url")
    private String sourceUrl;
    @Column(name = "click_rate")
    private Long clickRate;
    @Column(name = "comment_total")
    private Long commentTotal;
    @Column(name = "url")
    private String url;
    @Column(name = "content_type")
    @Enumerated(EnumType.STRING)
    private ArticleContentType articleContentType;
    @Column(name = "html_content")
    private String htmlContent;
    @Column(name = "native_content")
    private String nativeContent;
    @Column(name = "json_content")
    private String jsonContent;
    @Column(name = "text_content")
    private String textContent;
    @Column(name = "pigeonhole")
    private Long pigeonhole;
    @Column(name = "have_cover")
    private Boolean haveCover;
    @Column(name = "cover_image_url")
    private String coverImageUrl;
    @Column(name = "creator")
    private Long creator;
    @Column(name = "updater")
    private Long updater;
    @Column(name = "create_time")
    private Date createTime;
    @Column(name = "update_time")
    private Date updateTime;
}
